Reclaim process user space resource exit () function _ exit () function atexit () function on_exit () function, _ exitatexitAbstract:This article describes how to terminate a process and how to use the exit () function to terminate the process and
Abstract:This article describes how to terminate a process and how to use the exit () function to terminate the process and reclaim the user space resources of the process. It analyzes the exit () function and the _ exit () function, difference in
Note: Exit () is exited, the parameters passed in is the program exit status code, 0 for normal exit, the other means the abnormal exit, generally used-1 or 1, standard C has exit_success and exit_failure two macros, with exit (exit_success) ,
Exit () and _ exit () and return, exit_exitreturnThe difference between exit () and return: According to ansi c, return and exit () are used in the originally called main () with the same effect. However, note that "initial call" is used here ". If
The exit and _ exit functions are used to terminate a program normally: _ Exit immediately enters the kernel, and exit is used to execute some cleanup operations (including calling and executing various termination processes, close all standard I/O
Process 1 is the main first process init of all processes
How to view the process: PS uax
# Include # Include # Include # Include
Int main (){Pid_t PID;Int A = 8;Printf ("current process ID: % d \ n", getpid ());PID = fork ();If (pid> 0) // What
The difference between the Exit,_exit-The difference between exit () and _exit () function (Linux system) 2012-03-20 15:19:53Category: LINUX Note: exit () is exit, The passed-in parameter is the status code when the program exits, 0 -1 1 c
:
Exit command is, press ESC to jump to command mode, and then enter: Q (not saved) or: Wq (save) exit. more exit Commands:
: w save file but not exit VI: W file will be modified to save in file, do not exit VI: w! Mandatory save, do not launch VI:
The difference between exit () and return: According to ansi c, return and exit () are used in the originally called Main () with the same effect. However, note that "initial call" is used here ". If main () is in a recursive program, exit () will
These are process control processes, not built-in language elements.
However, abort is defined in the sysutils unit:
The entire program is exited by throwing a silent exception.
Exit is defined in the system unit and used to exit the process (in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.